﻿Public Class MyConfig
    Inherits wys.util.Config.Config

    Public Shared Property 连接字符串() As String
        Get
            Return GetValue("DbCon")
        End Get
        Set(ByVal value As String)
            SetValue("DbCon", value)
        End Set
    End Property

    Public Shared Property 前缀() As String
        Get
            Return GetValue("PreFix")
        End Get
        Set(ByVal value As String)
            SetValue("PreFix", value)
        End Set
    End Property

    Public Shared Property XSC使用() As Boolean
        Get
            Return CBool(GetValue("XSC"))
        End Get
        Set(ByVal value As Boolean)
            SetValue("XSC", CInt(value).ToString)
        End Set
    End Property

    Public Shared Property 使用组件() As List(Of String)
        Get
            Dim 组件 As String = GetValue("Addins")
            Dim lst As New List(Of String)

            For Each Str As String In 组件.Split(";")
                lst.Add(Str)
            Next

            Return lst

        End Get
        Set(ByVal value As List(Of String))

        End Set
    End Property

    Public Shared Property 配置连接类() As String
        Get
            Dim strpath As String = System.IO.Path.Combine(Application.StartupPath, "DB\ListenDb.db")
            If System.IO.File.Exists(strpath) Then
                Return "Data Source=" & strpath
            End If

            Return CStr(GetValue("ConfigDb"))
        End Get
        Set(ByVal value As String)
            SetValue("ConfigDb", value)
        End Set
    End Property

    Public Shared Property 自动刷新() As String
        Get
            Return CStr(GetValue("AutoRefresh"))
        End Get
        Set(ByVal value As String)
            SetValue("AutoRefresh", value)
        End Set
    End Property

    Public Shared Property 隐藏行头() As String
        Get
            Return CStr(GetValue("HideHeader"))
        End Get
        Set(ByVal value As String)
            SetValue("HideHeader", value)
        End Set
    End Property

    Public Shared Property 主窗口标题() As String
        Get
            Return CStr(GetValue("数据库监听"))
        End Get
        Set(ByVal value As String)
            SetValue("数据库监听", value)
        End Set
    End Property

    Public Shared Property 最后窗体宽度() As String
        Get
            Return CStr(GetValue("LastWidth"))
        End Get
        Set(ByVal value As String)
            SetValue("LastWidth", value)
        End Set
    End Property

    Public Shared Property 最后窗体高度() As String
        Get
            Return CStr(GetValue("LastHeight"))
        End Get
        Set(ByVal value As String)
            SetValue("LastHeight", value)
        End Set
    End Property

    Public Shared Property 最后左边距离() As String
        Get
            Return CStr(GetValue("LastLeft"))
        End Get
        Set(ByVal value As String)
            SetValue("LastLeft", value)
        End Set
    End Property

    Public Shared Property 最后上面距离() As String
        Get
            Return CStr(GetValue("LastTop"))
        End Get
        Set(ByVal value As String)
            SetValue("LastTop", value)
        End Set
    End Property
End Class
